package com.blyat.xsoft.kernel.component.security.oauth2.token;

import org.springframework.security.oauth2.common.OAuth2AccessToken;
import org.springframework.security.oauth2.provider.ClientDetailsService;
import org.springframework.security.oauth2.provider.token.TokenStore;

/**
 * @Auther: syh
 * @Date: 2020/7/22
 * @Description:
 */
public interface TokenRefreshExecutor {

    /**
     * 执行刷新
     * @return
     * @throws Exception
     */
    String refresh() throws Exception;

    /**
     * 是否需要刷新
     * @return
     */
    boolean shouldRefresh();

    void setTokenStore(TokenStore tokenStore);

    void setAccessToken(OAuth2AccessToken accessToken);

    void setClientService(ClientDetailsService clientService);
}
